﻿package mortal.game.view.nationalDayAct
{
    import com.mui.containers.globalVariable.*;
    import com.mui.controls.*;
    import extend.language.*;
    import fl.data.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.*;

    public class nationalDayActReturnPanel extends nationalDayActBasePanel
    {
        private var _giftList:GTileList;

        public function nationalDayActReturnPanel()
        {
            super(3);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.nationalDayActSecondTxt3, 102, 65, this));
            pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.nationalDayActGiftBagBg, 50, 358 - 34, this));
            pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.nationalDayActReturnRewardTxt, 130 + 151 - 5, 382 - 34, this));
            pushUIToDisposeVec(UIFactory.gTextField(Language.getString(90459), 302, 533 - 50 + 40, 380, 40, this, GlobalStyle.textFormatBai.setSize(16), true));
            this._giftList = UIFactory.tileList(150 - 35, 415 - 34, 500, 80, this);
            this._giftList.columnWidth = 80;
            this._giftList.rowHeight = 80;
            this._giftList.horizontalGap = 0;
            this._giftList.verticalGap = 0;
            this._giftList.setStyle("cellRenderer", nationalDayActGiftCellRender);
            this._giftList.dataProvider = this.getGiftListDataProviderByCode(120101404);
            this._giftList.direction = GBoxDirection.HORIZONTAL;
            this._giftList.drawNow();
            return;
        }// end function

        private function getGiftListDataProviderByCode(param1:int) : DataProvider
        {
            var _loc_5:Array = null;
            var _loc_6:ItemData = null;
            var _loc_9:nationalDayActGiftDataGroup = null;
            var _loc_2:* = new DataProvider();
            var _loc_3:* = new ItemData(param1).itemInfo as ItemGiftBagInfo;
            var _loc_4:* = _loc_3.itemList1.split("&");
            var _loc_7:* = _loc_4.length;
            var _loc_8:int = 0;
            while (_loc_8 < _loc_4.length)
            {
                
                _loc_5 = _loc_4[_loc_8].split("#");
                _loc_6 = new ItemData(int(_loc_5[1]));
                _loc_9 = new nationalDayActGiftDataGroup();
                _loc_9.itemCode = int(_loc_5[1]);
                _loc_9.itemData = _loc_6;
                _loc_9.itemAmount = _loc_5[2];
                _loc_9.isBind = true;
                _loc_2.addItem(_loc_9);
                _loc_8++;
            }
            return _loc_2;
        }// end function

        override protected function setDescTxt() : void
        {
            this._actDescTxt.htmlText = Language.getString(90479);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            return;
        }// end function

    }
}
